Introduction
Hridaya Steam Market Tracker stores all data in a SQLite database (market_data.db). The schema is designed to capture different aspects of market data across four specialized tables.
Database Location
Architecture
Storage Strategy
- SQLite for operational snapshots (real-time data)
- TimescaleDB (optional) for historical time-series data
- Write-Ahead Logging (WAL) for concurrent access
- Automatic indexing on common query patterns
Performance Optimizations
Schema Tables
The database contains four main tables, each serving a specific purpose:price_overview
Current market prices, volumes, and snapshots - the data you see on item listing pages
orders_histogram
Full order book snapshots with buy/sell orders at each price level
orders_activity
Recent trade activity feed - actual purchases and new listings as they happen
price_history
Historical hourly price and volume data going back years
Common Patterns
Timestamps
- All timestamps are stored in UTC
- Format:
DATETIMEtype in SQLite - Automatically set to
CURRENT_TIMESTAMPon insert
Item Identification
Every record includes:appid- Steam application ID (730 for CS2, 570 for Dota 2, etc.)market_hash_name- Exact item name (e.g., “AK-47 | Redline (Field-Tested)”)item_nameid- Steam’s internal numeric item ID (optional for some endpoints)
Localization Fields
All tables store the request context:currency- ISO 4217 code (USD, EUR, GBP, etc.)country- Two-letter country code (US, GB, etc.)language- Language used for request (english, french, etc.)
JSON Data
Complex structures are stored as JSON strings:- Order books (
buy_order_table,sell_order_table) - Activity feeds (
parsed_activities) - Graph data for visualization
json_extract() function to query JSON fields.
Indexes
All tables are indexed for optimal query performance:Connecting to the Database
Using SQLite CLI
Using Python
Using Python Async
Next Steps
Table Schemas
Detailed schema documentation for each table
Query Examples
Common SQL query patterns and examples